<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <script>
      // 测试跨域的错误
      async function news () {
        const res = await axios({
          url: 'http://autumnfish.cn:8866/api/news'
        })
        console.log('res:', res)
      }
      news()

      // 测试 之前的新闻接口
      // async function news2 () {
      //   const res = await axios({
      //     url: 'http://ajax-api.itheima.net/api/news'
      //   })
      //   console.log('res:', res)
      // }
      // news2()
    </script>
  </body>
</html>
